<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8"/>
    <title>userList</title>
    <link rel="stylesheet" th:href="@{/css/bootstrap.css}"></link>
</head>
<body class="container">
<br/>
<h1><a th:href="@{/}">用户列表</a></h1>
<br/><br/>
<div class="with:80%">
    <table class="table table-hover">
        <thead>
        <tr>
            <th colspan="3">
				<form class="form-horizontal" th:action="@{/findByUserName}" method="post">
					<span>用户名:</span> 
					<input name="userName" type="text" placeholder="输入用户名查询"/> 
					<input type="submit" value="查询" class="btn btn-info"/>
				</form>
			</th>	
			<th colspan="3">	
				<form class="form-horizontal" th:action="@{/findByUserNameOrEmail}" method="post">
					<span>用户/邮箱:</span> 
					<input name="userName" type="text" placeholder="输入用户名或者邮箱查询"/> 
					<input type="submit" value="查询" class="btn btn-info"/>
				</form>
			</th>		
			<th colspan="3">	
				<form class="form-horizontal" th:action="@{/findByEmailLike}" method="post">
					<span>邮箱:</span> 
					<input name="email" type="text" placeholder="输入邮箱模糊查询"/> 
					<input type="submit" value="查询" class="btn btn-info"/>
				</form>
			</th>
        </tr>
        </thead>
        <thead>
        <tr>
            <th colspan="3">
				<form class="form-horizontal" th:action="@{/findByUserNameIgnoreCase}" method="post">
					<span>用户名:</span> 
					<input name="userName" type="text" placeholder="不考虑大小写查找用户查询"/> 
					<input type="submit" value="查询" class="btn btn-info"/>
				</form>
			</th>	
			<th colspan="3">
				<form class="form-horizontal" th:action="@{/findByUserNameOrderByEmailDesc}" method="post">
					<span>邮箱名:</span> 
					<input name="userName" type="text" placeholder="根据userName查找用户列表并根据email降序排列"/> 
					<input type="submit" value="查询" class="btn btn-info"/>
				</form>
			</th>	
			<th colspan="2"></th>
            <th class="col-sm-2 control-label">
				<a href="/toAdd" th:href="@{/toAdd}" class="btn btn-info">新增</a>
			</th>
        </tr>
        </thead>
        <thead>
        <tr>
            <th>ID主键</th>
            <th>用户名</th>
            <th>密码</th>
            <th>邮箱</th>
            <th>电话</th>
            <th>性别</th>
            <th colspan="2">出生年月</th>
            <th colspan="2">注册时间</th>
            <th>修改用户</th>
            <th>删除用户</th>
        </tr>
        </thead>
        <tbody>
        <tr  th:each="user : ${users}">
            <td scope="row" th:text="${user.id}"></td>
            <td th:text="${user.userName}"></td>
            <td th:text="${user.passWord}"></td>
            <td th:text="${user.email}"></td>
            <td th:text="${user.phone}"></td>
            <td th:text="${user.sex}"></td>
            <td th:text="${user.birthday}" colspan="2"></td>
            <td th:text="${user.regTime}" colspan="2"></td>
            <td><a th:href="@{/toEdit(id=${user.id})}">修改</a></td>
            <td><a th:href="@{/delete(id=${user.id})}">删除</a></td>
        </tr>
        </tbody>
    </table>
</div>
</body>
</html>